from datetime import datetime
from typing import Optional, List

from pydantic import BaseModel, Field


class FeatureListDto(BaseModel):
    sys_name: str = Field(..., title="系统名称")
    amount:int = Field(10, title="生成功能的数量", description="生成功能的数量，默认值是10，越多越慢，用户要求多可以加钱")
    tech_stack: str = Field(..., title="技术栈")

class AppConfigDto(BaseModel):
    sc_id:str = Field(..., title="id")
    sys_name: str = Field(..., title="系统名称")
    feature_list: list[dict[str,str]] = Field(..., title="功能列表")
    user_name: str = Field(..., title="名称")
    certificate_type: str = Field(..., title="证件类型")
    certificate_no: str = Field(..., title="证件号码")
    addr:str = Field(..., title="地址")
class TeDto(BaseModel):
    """
    测试数据
    """
    id:str = Field(..., title="id")
    system_name:str = Field(..., title="id")
    feature_list: list[dict[str,str]] = Field(..., title="功能列表")
    tech_stack: str = Field(..., title="技术")
class PageDto(BaseModel):
    """
    页面数据
    """
    page_num: int = Field(..., title="页码")
    page_size: int = Field(20, title="每页数量,默认20")
class SoftCopyrightResponse(BaseModel):
    id: str
    system_name: str
    tech_stack: Optional[str] = None
    feature_list: Optional[List] = None
    config_data: Optional[str] = None
    created_time: Optional[datetime] = None
    preview_url: Optional[str] = None
    introduction_doc: Optional[str] = None
    introduction_pdf: Optional[str] = None
    operation_doc: Optional[str] = None
    operation_pdf: Optional[str] = None
    code_doc: Optional[str] = None
    code_pdf: Optional[str] = None
    function_list_url: Optional[str] = None
    status: Optional[int] = None

    class Config:
        from_attributes = True

